home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / Developer University / DU Projects / DTSFinance Test / main.cpp < prev   
Encoding:
C/C++ Source or Header  |  1996-12-11  |  738 b   |  29 lines  |  [TEXT/CWIE]

  1. //    Dave Wilson
  2. //    10-19-96 For Direct-To-SOM
  3.  
  4. //==============================================
  5. #ifndef DTSFINANCE_HH
  6.     #include "DTSFinance.hh"    // DTSFinance
  7. #endif 
  8.  
  9. #include "som.xh"                // somGetGlobalEnvironment
  10.  
  11. #include <iostream.h>            // for cout
  12.  
  13. //==============================================
  14. void 
  15. main()
  16. {
  17.     double payment = 1000;
  18.     short paymentsPerYear = 12;
  19.     short compoundsPerYear = 4; 
  20.     double annualInterestPercent = 6.0; 
  21.     double years = 15;
  22.     Environment* ev = somGetGlobalEnvironment();
  23.     DTSFinance* f = new DTSFinance();
  24.     double    amountSaved = f->FutureValueWithPayments(ev,
  25.                 payment, paymentsPerYear, compoundsPerYear, 
  26.                 annualInterestPercent, years);
  27.     cout << "amount saved = " << amountSaved << endl;
  28.     delete f;
  29. }